package algorithm.classification.binary.parameters;

import algorithm.classification.functionsandloss.Loss;
import data.vectors.DoubleVector;
import data.vectors.DoubleVectorWritable;
import data.vectors.implementation.DoubleVector_Sparse_Memory;

public class PerceptronParameters extends BinaryLearningClassifierParameter{
//	public DoubleVectorWritable w;
	public int nbiterations;
	public double step;
	public Loss loss;
	public double lambda;
	public int nbupdate;
	public double[] lossIter;
	public boolean weightDecay;
	
	public PerceptronParameters(){}
	
	public PerceptronParameters(int nbiterations, double step,Loss loss,double lambda,
			int nbupdate, boolean weightDecay){
		super();
		this.nbiterations = nbiterations;
		this.step = step;
		this.loss = loss;
		this.lambda=lambda;
		this.nbupdate=nbupdate;
		this.weightDecay = weightDecay;
		
		lossIter = new double[nbiterations];
		
	}
	
	/**
	 * @return the lossIter
	 */
	public double[] getLossIter() {
		return lossIter;
	}

	/**
	 * @param lossIter the lossIter to set
	 */
	public void setLossIter(int i, double loss) {
		this.lossIter[i] = loss;
	}

//	public void setWeight(DoubleVector w){
//		this.w = new DoubleVector_Sparse_Memory(w);
//	}
//	public DoubleVectorWritable getWeight(){
//		return this.w;
//	}
	
	public void setLoss(Loss loss){
		this.loss = loss;
	}
	public Loss getLoss(){
		return this.loss;
	}
	
	public void setLambda(double lambda){
		this.lambda = lambda;
	}
	public double getLambda(){
		return this.lambda;
	}
	
	public void setStep(double stpSize){
		this.step = stpSize;
	}
	public double getStep(){
		return this.step;
	}
	
	/**
	 * @return the weightDecay
	 */
	public boolean isWeightDecay() {
		return weightDecay;
	}

	public void setNumUpdate(int numUp){
		this.nbupdate = numUp;
	}
	public int getNumUpdate(){
		return this.nbupdate;
	}
	
	public void setNumIter(int numIter){
		this.nbiterations = numIter;
	}
	public int getNumIter(){
		return this.nbiterations;
	}
	
//	public void init(int dimension){	
//		w = new DoubleVector_Sparse_Memory(dimension);
//	}

//	public PerceptronParameters clone() {
//		PerceptronParameters cp = new PerceptronParameters();
//		cp.lambda =this.lambda;
//		cp.nbiterations = this.nbiterations;
//		cp.nbupdate = this.nbupdate;
//		cp.step = this.step;
//		
//		return cp;
//	}
}
